package sh.wn36.vehiclemanage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import sh.wn36.vehiclemanage.entity.RefuelingRecord;
import sh.wn36.vehiclemanage.mapper.RefuelingRecordMapper;
import sh.wn36.vehiclemanage.service.RefuelingRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import sh.wn36.vehiclemanage.xzy.RefuelingInfo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author xk
 * @since 2021-04-26
 */
@Service
public class RefuelingRecordServiceImpl extends ServiceImpl<RefuelingRecordMapper, RefuelingRecord> implements RefuelingRecordService {

    @Autowired
    private RefuelingRecordMapper recordMapper;

    @Override
    public IPage<RefuelingInfo> getAll(Page<RefuelingInfo> page, QueryWrapper<RefuelingInfo> wrapper) {
        return recordMapper.selectPage(page,wrapper);
    }

    @Override
    public RefuelingInfo findById(Integer id) {
        return recordMapper.findById(id);
    }

    @Override
    public List<Map<String, Object>> reportList() {
        return recordMapper.reportList();
    }

    @Override
    public List<Map<String, Object>> queryReportByCarId(Integer carId) {
        return recordMapper.queryReportByCarId(carId);
    }
}
